# RUN: not tfg-translate -graphdef-to-mlir %s 2>&1 | FileCheck %s

# CHECK: INVALID_ARGUMENT: Invalid dtype for handle_data

library {
  function {
    signature {
      name: "XTimesTwo"
      input_arg {
        name: "x"
        type_attr: "T"
      }
      output_arg {
        name: "y"
        type_attr: "T"
        # This empty handle_data is invalid.
        handle_data {
        }
      }
      attr {
        name: "T"
        type: "type"
        allowed_values {
          list {
            type: DT_FLOAT
            type: DT_DOUBLE
            type: DT_INT32
            type: DT_INT64
          }
        }
      }
    }
    node_def {
      name: "two"
      op: "Const"
      attr {
        key: "dtype"
        value {
          type: DT_INT64
        }
      }
      attr {
        key: "value"
        value {
          tensor {
            dtype: DT_INT64
            tensor_shape {
            }
            int64_val: 2
          }
        }
      }
    }
    node_def {
      name: "scale"
      op: "Cast"
      input: "two:output:0"
      attr {
        key: "DstT"
        value {
          placeholder: "T"
        }
      }
      attr {
        key: "SrcT"
        value {
          type: DT_INT64
        }
      }
    }
    node_def {
      name: "y"
      op: "Mul"
      input: "x"
      input: "scale:y:0"
      attr {
        key: "T"
        value {
          placeholder: "T"
        }
      }
    }
    ret {
      key: "y"
      value: "y:z:0"
    }
  }
}
versions {
  producer: 762
}

